var express = require('express');
var fs = require('fs');
var app = express();
app.use(express.static('../kad'),function (req,res,next){
	next();
});
app.all('*',function(req,res,next){
	res.header("Access-Control-Allow-Origin", "*");
	res.header("Access-Control-Allow-Headers", "X-Requested-With");
	res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
	res.header("X-Powered-By",' 3.2.1');
	res.header("Content-Type", "application/json;charset=utf-8");
    next();
});
app.get('/hot1',function(req,res){
    fs.readFile('node/1.json',function(err,data){
        console.log(1)
        res.send(data)
    });
});
app.get('/hot',function(req,res){
    fs.readFile('node/home.json',function(err,data){
    	console.log(2)
    	res.send(data)
    });
});
app.get('/home_seckill',function(req,res){
    fs.readFile('node/home_seckill.json',function(err,data){
        console.log(3)
        res.send(data)
    });
});
app.get('/home_seckill-2',function(req,res){
    fs.readFile('node/home_seckill-2.json',function(err,data){
        console.log(4)
        res.send(data)
    });
});
app.get('/classify-class',function(req,res){
    fs.readFile('node/classify-class.json',function(err,data){
    	console.log(5)
    	res.send(data)
    });
});
app.get('/classify-doc',function(req,res){
    fs.readFile('node/classify-doc.json',function(err,data){
    	console.log(6)
    	res.send(data)
    });
});
app.get('/classify-sex',function(req,res){
    fs.readFile('node/classify-sex.json',function(err,data){
    	console.log(7)
    	res.send(data)
    });
});
app.get('/ganmaofashao',function(req,res){
    fs.readFile('node/ganmaofashao.json',function(err,data){
    	console.log(8)
    	res.send(data)
    });
});
app.get('/like',function(req,res){
    fs.readFile('node/like.json',function(err,data){
        console.log(9)
        res.send(data)
    });
});
app.get('/seckill',function(req,res){
    fs.readFile('node/seckill.json',function(err,data){
        console.log(10)
        res.send(data)
    });
});
app.get('/buyCar',function(req,res){
    fs.readFile('node/buyCar.json',function(err,data){
        console.log(11)
        res.send(data)
    });
});
app.listen(8888,function(){
	console.log('服务已启动')
});
